package com.shop.feignClient;


import com.shop.po.R;
import com.shop.po.dto.OrderDetailInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "shopping-user-api")
public interface UserClient {

    @GetMapping("/order/merchantGetOrderInfo")
    public List<OrderDetailInfo> merchantGetOrderInfo(
            @RequestParam(value = "merchantId",required = true) Long merchantId,
            @RequestParam(value = "state",required = false) String state,
            @RequestParam(value = "currentPage",required = true) Long page,
            @RequestParam(value = "size",required = true) Long size
    );

    @GetMapping("/order/merchantGetTotal")
    public Long merchantGetTotal(
            @RequestParam(value = "merchantId",required = true) Long merchantId,
            @RequestParam(value = "state",required = false) String state
    );

    //修改订单详情的状态
    @PostMapping("/order/changState/{state}/{orderDetailsId}")
    public R changState(@PathVariable("state")String state,
                        @PathVariable("orderDetailsId") String orderDetailsId);

}
